<?php
/*
<Model Information> 
Author: Naseer Ahmad
Date: 12-10-2011
Last Updated on: 13-10-2011 
*/


class adminLoginModel extends appModel
{
	var $name = 'adminLoginModel';
	
	function verifyLogin($username, $password)
	{
		$expire = time() + 3600 * 24; 
		$password = md5($password);
		$res = $this -> _getRowData('usersInfo', 'userID, userName', 
						"userEmail = '$username' AND userPassword = '$password' AND userType='Admin'");
		if($res):
			setcookie("adminid_gosell", $res['userID'], $expire, "/");
			setcookie("adminname_gosell", $res['userName'], $expire, "/");
			return true;
		else:
			return false;
		endif;
	}

}

?>